package com.mobilepoc.jersey;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.mobilepoc.jersey.model.Account;
import com.mobilepoc.jersey.model.AccountInformation;
import com.mobilepoc.jersey.storage.AccountStorage;

@Path("/accounts")
public class AccountsRetriever {

    @GET
    @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
    public List<Account> getString() throws InterruptedException {
        Thread.sleep(500);
        return AccountStorage.getAccounts();
    }

    @GET
    @Path("/{arrangementId}")
    @Produces(MediaType.APPLICATION_JSON)
    public AccountInformation getOneAccount(@PathParam("arrangementId") String arrangementId) throws InterruptedException {
        Thread.sleep(500);
        return AccountStorage.getAccountInformation(arrangementId);
    }

}
